package com.thn.dw.realtimebehavior.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RocketMQMessageListener(
    topic = "UCL-TOPIC",
    consumerGroup = "user-click-log-consumer-group",
    selectorType = SelectorType.TAG,
    selectorExpression = "ID='ucl_id_00123' AND DATE>=2025-06-30",
    instanceName = "UserClickLogConsumer",
    maxReconsumeTimes = 3,
    messageModel = MessageModel.CLUSTERING,
    consumeMode = ConsumeMode.ORDERLY // 顺序发消费模式
)
public class UserClickLogConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("RDW ETL 日志抓取模块 采集数据: {}", message);
    }
}
